
import java.util.Scanner;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: user
 * Date: 2023-10-30
 * Time: 20:09
 */
public class Test {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNextLine()) {
            String str = in.nextLine();
            String[] strings = str.split(" ");
            System.out.println(strings[strings.length-1].length());
        }
    }

    public static void main12(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNextLine()) {
            String str = in.nextLine();
            int index = str.lastIndexOf(" ");
            String ret = str.substring(index+1);
            System.out.println(ret.length());
        }
    }

    public int firstUniqChar(String s) {

        int[] count = new int[26];
        for(int i = 0;i < s.length();i++) {
            char ch = s.charAt(i);
            count[ch-'a']++;
        }

        for(int i = 0;i < s.length();i++) {
            char ch = s.charAt(i);
            if(count[ch-'a'] == 1) {
                return i;
            }
        }
        return -1;
    }

    public static void main2(String[] args) {
        String s = "hello";
        for (int i = 0; i < 10; i++) {
            s += i;
        }
        System.out.println(s);
    }

    public static void main3(String[] args) {
       /* String s = "hello";
        s += " world";
        System.out.println(s);  // 输出：hello world
*/
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("hello");
        stringBuilder.append("world");
       /* String s = stringBuilder.toString();
        System.out.println(s);*/
        System.out.println(stringBuilder);

        stringBuilder.reverse();

        System.out.println(stringBuilder);

        System.out.println("=======================");
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("hello");
        stringBuffer.append("world");
        System.out.println(stringBuffer);

        stringBuffer.reverse();

        System.out.println(stringBuffer);

    }
    public static void main1(String[] args) {
        String s = "hello";
        s += " world";
        System.out.println(s);  // 输出：hello world
    }
}
